package com.situ.dao;

import com.situ.entity.Food;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface Fooddao {

    @Select("select *from food order by id desc")
    public List<Food> queryall();

    @Insert("insert into food(name,pic) values(#{name},#{pic})")
    public void save(Food food);

    @Delete("delete from food where id=#{id}")
    public void delete(int id );

    @Select("select * from food where id = #{id}")
    public Food querybyid(int id);
}
